#ifndef __ACCEPTOR_H__
#define __ACCEPTOR_H__

#include "socket.h"
#include "inetAddress.h"
#include <string>

using std::string;

class Acceptor
{
public:
	Acceptor(const string & ip,unsigned short port);

	~Acceptor();

	void ready();

	int accept();

	int fd() const;

private:
	void setReuseAddr();

	void setReusePort();

	void bind();

	void listen();
	

private:
	Socket _socket;
	InetAddress _addr;
};
#endif
